package com.wsoft.form.query.column;

import com.wsoft.form.dto.WfLinkQuerysDTO;
import com.wsoft.form.dto.WfLinkWheresDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author z001
 * @Date 2024/9/8 08:25
 */
@Data
public class ColumnInsertQuery {

    @Schema(description = "表单Id")
    private Long formId;

    @NotNull(message = "数据表id不能为空")
    @Schema(description = "数据表Id")
    private Long tableId;

    @NotBlank(message = "数据表id不能为空")
    @Schema(description = "字段名")
    private String columnName;

    @NotBlank(message = "显示名不能为空")
    @Schema(description = "显示名")
    private String name;

    @NotBlank(message = "字段类别不能为空")
    @Schema(description = "数据表中的字段类型")
    private String columnType;

    @Schema(description = "数据表中的完整字段类型(包括了精度和刻度)")
    private String fullColumnType;

    @Schema(description = "是否可以为空 (0: 不可以为空 1: 可以为空)")
    private Integer validIsNull;

    @Schema(description = "缺省值")
    private String columnDefault;

    @Schema(description = "字段在数据表中的显示位置")
    private Integer columnSort;

    @Schema(description = "数据表中的字段注释")
    private String columnComment;

    @Schema(description = "字段类别")
    private Integer fieldKind;

    @Schema(description = "包含的文件文件数量，0表示无限制")
    private Integer maxFileCount;

    @Schema(description = "编码规则的JSON格式数据")
    private String encodedRule;

    @Schema(description = "字典Id")
    private String dictCode;

    @Schema(description = "关联formId")
    private Long linkFormId;

    @Schema(description = "设计表id")
    private Long designId;

    @Schema(description = "主字段id")
    private Long columnMasterId;

    @Schema(description = "关联字段")
    private List<WfLinkQuerysDTO> querysList;

    @Schema(description = "关联条件")
    private List<WfLinkWheresDTO> wheresList;

    @Schema(description = "字段默认值/默认长度")
    private String dataType;

    @Schema(description = "查询时数据排序顺序 0/null 不排序，1优先排序")
    private Integer orderNo;

    @Schema(description = "asc/desc")
    private String orderType;

}
